package home

import (
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
	newsService "myblog/app/service/module/news"
	"myblog/app/utils/response"
)

/*
  Home
  @Author: 皓云
  @Description: 首页置顶文章 最新文章 等
  @param r
  @Date: 2021-09-01 10:40:52
  @Filepath:
*/
func Home(r *ghttp.Request) {
	//置顶文章
	topnews, _ := newsService.TopIndex(3)
	//最新文章
	indexshow, _ := newsService.Indexshow(10)
	response.BuildTpl(r, "home/index.html").WriteTpl(g.Map{
		"topnews":   topnews,
		"indexshow": indexshow,
	})
}
